﻿/*
 * GridData
 * 
 * initial implementation : 20.11.2008
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
using System.Collections.Generic;
using Petra.Gis.Geometry.Support;


namespace Petra.Gis.Geometry.GridSupport
{
  /// <summary>
  /// GridData base object understand particular grid data formats and can process grid data.
  /// Grid cells are usually stored as organized and high compressed data structure in files (or file streams),
  /// to save disk capacity. Different decoders exists for different GridData types (bmp, gif, tiff,...) 
  /// Grid data are sometimes organized into layers called Frames. Frame represents multiple Grid data stored
  /// on same location, with same world/projection extent as variants or with different resolution.
  /// Overviews is special case of Frames that represents subsampled version of original grid.
  /// </summary>
  public abstract class GridDataBase
  {
    //object _decoder;
    //protected string _dataLocation;
    protected List<GridFrameBase> _frames;
    protected BoundingBox _bounds;



    protected GridDataBase()
    {
      _frames = new List<GridFrameBase>();
    }


    //public GridData(string gridFile, BoundingBox bounds) { }


    

    //public GridData(Array gridDataArray, int gridWidth, int gridHeight, int stride, BoundingBox bounds)
    //{

    //  //single frame with single block (all in memory) grid

    //}






    /// <summary>
    /// get list of available frames in GridData
    /// </summary>
    public List<GridFrameBase> Frames
    {
      get { return _frames; }
    }






    /// <summary>
    /// must override in grid decoder. True when GridData supports Overviews
    /// </summary>
    public abstract bool IsGridWithOverviews {get;}






    ///// <summary>
    ///// string (usually filename) representing location of GridData.
    ///// </summary>
    //public string DataLocation
    //{
    //  get { return _dataLocation; }
    //  set { _dataLocation = value; }
    //}





    /// <summary>
    /// string (usually filename) representing location of GridData.
    /// </summary>
    public Uri DataLocation { get; protected set; }






    /// <summary>
    /// returns grid projection bounds.
    /// </summary>
    /// <returns>BoundingBox of GridData data</returns>
    public BoundingBox GetEnvelope()
    {
      return _bounds;
    }



  }

}
